<template>
	<view class="jianglimx">
		<view class="neirong" v-for="item in duihuanfuliList">
			<view class="left">
				<image class="tupian" src="../static/qiandao/jianbi.png" mode="" v-show="item.profitType!=3"></image>
				<image class="tupian" src="../static/qiandao/jianbihui.png" mode="" v-show="item.profitType==3"></image>
				<view class="tupianname">
					<view class="qiandaoname" v-show="item.profitType==1">
						签到红包
					</view>
					<view class="qiandaoname" v-show="item.profitType==2">
						任务返现
					</view>
					<view class="qiandaoname" v-show="item.profitType==3">
						兑换红包
					</view>
					<view class="qiandoashijian">
						{{ zhuanhaun(item.gmtCreate)}}
					</view>
				</view>
			</view>
			<view class="right" v-show="item.profitType!=3">
				+{{item.profitMoney}}元
			</view>
			<view class="righth" v-show="item.profitType==3">
				-{{item.profitMoney}}元
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				duihuanfuliList: [],
			}
		},
		onLoad(option) {


		},
		onShow() {
			this.getalljuan()
		},
		methods: {
			//时间转换
			zhuanhaun(date) {
				var date = new Date(date);
				var YY = date.getFullYear() + '-';
				var MM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
				var DD = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate());
				var hh = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
				var mm = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
				var ss = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
				return YY + MM + DD + " " + hh + mm + ss;
			},

			//获取用户签到收益记录
			getalljuan() {
				var that = this
				that.$api
					.request('sign', 'ProfitList', {}, failres => {
						that.$api.msg(failres.errmsg);
						uni.hideLoading();
					})
					.then(res => {
						debugger
						if (res.errno == '200') {
							debugger
							that.duihuanfuliList = res.data
						}
					});
			},
		}
	}
</script>

<style lang="scss">
	.jianglimx {
		.neirong {
			width: 690rpx;
			height: 75rpx;
			margin-left: 30rpx;
			margin-top: 24rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.righth {
				font-size: 32rpx;
				font-family: PingFangSC-Medium, PingFang SC;
				font-weight: 500;
				color: #333333;
			}

			.right {
				font-size: 32rpx;
				font-family: PingFangSC-Medium, PingFang SC;
				font-weight: 500;
				color: #FFA638;
			}

			.left {
				display: flex;
				align-items: center;

				.tupianname {
					margin-left: 16rpx;

					.qiandoashijian {
						font-size: 24rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						color: #666666;
					}

					.qiandaoname {
						font-size: 28rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						color: #333333;
					}
				}

				.tupian {
					width: 56rpx;
					height: 56rpx;
				}

			}
		}
	}
</style>
